Skip to content

Fix expired Valid-Until bypass missing on second apt-get update in builder-buster#24

Merged
hsbt merged 2 commits intosplit-image-buildfrom
copilot/sub-pr-23
Mar 4, 2026
Merged

Fix expired Valid-Until bypass missing on second apt-get update in builder-buster#24
hsbt merged 2 commits intosplit-image-buildfrom
copilot/sub-pr-23

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

The builder-buster stage targets archive.debian.org (Buster), whose metadata has expired Valid-Until headers. The first apt-get update correctly bypassed this with -o Acquire::Check-Valid-Until=false, but the second apt-get update — run after adding the i386 architecture and deb-src — was missing the flag, causing flaky/failing builds.

Change

  • Added -o Acquire::Check-Valid-Until=false to the second apt-get update in builder-buster:
RUN dpkg --add-architecture i386 \
  && echo "deb-src http://archive.debian.org/debian/ buster main" > /etc/apt/sources.list.d/deb-src.list \
  ...
  && apt-get update -o Acquire::Check-Valid-Until=false \  # was missing this flag
  && apt-get install ...

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…er-buster

Co-authored-by: hsbt <12301+hsbt@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor Dockerfile for better parallel builds in GitHub Actions Fix expired Valid-Until bypass missing on second apt-get update in builder-buster Mar 4, 2026
Copilot finished work on behalf of hsbt March 4, 2026 05:34
@hsbt hsbt marked this pull request as ready for review March 4, 2026 05:35
Copilot AI review requested due to automatic review settings March 4, 2026 05:35
@hsbt hsbt merged commit b98af80 into split-image-build Mar 4, 2026
@hsbt hsbt deleted the copilot/sub-pr-23 branch March 4, 2026 05:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the builder-buster Docker build stage by ensuring apt metadata expiration checks are consistently bypassed when updating from archive.debian.org (Debian Buster).

Changes:

  • Adds -o Acquire::Check-Valid-Until=false to the second apt-get update in the builder-buster stage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread Dockerfile
Comment on lines 20 to +24
RUN dpkg --add-architecture i386 \
&& echo "deb-src http://archive.debian.org/debian/ buster main" > /etc/apt/sources.list.d/deb-src.list \
&& echo 'Dpkg::Use-Pty "0";\nquiet "2";\nAPT::Install-Recommends "0";' > /etc/apt/apt.conf.d/99autopilot \
&& echo 'Acquire::HTTP::No-Cache "True";' > /etc/apt/apt.conf.d/99no-cache \
&& apt-get update \
&& apt-get update -o Acquire::Check-Valid-Until=false \
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stage now passes -o Acquire::Check-Valid-Until=false, but the flag is duplicated across multiple apt-get update calls (and was easy to miss previously). Consider setting Acquire::Check-Valid-Until "false"; in an apt.conf.d file for the builder-buster stage instead, so any future apt-get update/apt invocations inherit it automatically.

Copilot uses AI. Check for mistakes.
Comment thread Dockerfile
&& echo 'Dpkg::Use-Pty "0";\nquiet "2";\nAPT::Install-Recommends "0";' > /etc/apt/apt.conf.d/99autopilot \
&& echo 'Acquire::HTTP::No-Cache "True";' > /etc/apt/apt.conf.d/99no-cache \
&& apt-get update \
&& apt-get update -o Acquire::Check-Valid-Until=false \
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling APT’s Valid-Until check via -o Acquire::Check-Valid-Until=false weakens the repository freshness guarantee and enables replay/freeze attacks on package metadata. A network attacker who can intercept HTTP traffic to the Debian archive can replay an older, still-signed Release file and package index, causing your build to pull stale or more vulnerable package versions than intended. Consider avoiding this override if possible (e.g., by using a maintained base image, pinned snapshot, or other mechanism) so that APT continues enforcing metadata expiration.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants